package net.nagaseyasuhito.nicola.page;

import java.util.List;

import net.nagaseyasuhito.nicola.component.EntriesPanel;
import net.nagaseyasuhito.nicola.entity.Entry;

public class IndexPage extends BasePage {
	private static final long serialVersionUID = 1L;

	public IndexPage() {
		this.add(new EntriesPanel("entries", 10) {
			private static final long serialVersionUID = 1L;

			@Override
			public List<Entry> loadEntries(int firstResult, int maxResults) {
				return this.entryService.findAll(firstResult, maxResults);
			}
			
			@Override
			public long countEntries() {
				return this.entryService.countAll();
			}
		});
	}
}
